﻿/*----------------------------------------------------------------------------------------
*
*  Copyright 2019, Gao Hai Hui, <fromzeropoint@126.com>.  All rights reserved.
*  https://gitee.com/helloworldghh/xoskit.git
*  Use of this source code is governed by a MIT license
*  that can be found in the License file.
*
----------------------------------------------------------------------------------------*/
#ifndef __XOSKIT_XOS_CORE_XOS_STL_SRC_TOOLS_FUNCTIONALS_H__
#define __XOSKIT_XOS_CORE_XOS_STL_SRC_TOOLS_FUNCTIONALS_H__

#include <functional>
#include <algorithm>

namespace xos_stl
{

    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //
    // template compare functions
    // 

    template< class Type >
    bool p_equal_to( const Type * arg1, const Type * arg2 )
    {
        return ( *arg1 == *arg2 );
    }

    template< class Type >
    bool p_greater( const Type * arg1, const Type * arg2 )
    {
        return ( *arg1 > *arg2 );
    }

    template< class Type >
    bool p_greater_equal( const Type * arg1, const Type * arg2 )
    {
        return ( *arg1 >= *arg2 );
    }

    template< class Type >
    bool p_less( const Type * arg1, const Type * arg2 )
    {
        return ( *arg1 < *arg2 );
    }

    template< class Type >
    bool p_less_equal( const Type * arg1, const Type * arg2 )
    {
        return ( *arg1 <= *arg2 );
    }

} // xos_stl

#endif // __XOSKIT_XOS_CORE_XOS_STL_SRC_TOOLS_FUNCTIONALS_H__
